package com.yytek.nmp.api;

import com.yytek.common.core.constant.ServiceNameConstants;
import com.yytek.common.core.domain.R;
import com.yytek.nmp.api.domain.IotDeviceInfo;
import com.yytek.nmp.api.domain.UpgradeFirmware;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 查询设备业务相关
 */
@FeignClient(contextId = "remoteNmpService", value = ServiceNameConstants.NMP_SERVICE)
public interface RemoteNmpService {

    /**
     * 查询设备相关缓存信息
     * @param id 设备id
     * @return
     */
    @PostMapping("/device/getDeviceCache")
    R<?> getDeviceCache(@RequestParam("id") String id);

    /**
     * 查询设备列表信息
     * @param devcie
     * @return
     */
    @PostMapping("/device/selectDeviceInfoList")
    R<List<IotDeviceInfo>> selectDeviceInfoList(@RequestBody IotDeviceInfo devcie);

    /**
     * 发送设备升级信息
     * @param iotId
     * @param upgradeStrategyId
     * @return
     */
    @PostMapping("/device/sendDeviceUpgradeMsg")
    R sendDeviceUpgradeMsg(@RequestParam("iotId")String iotId,
                           @RequestParam("upgradeStrategyId")String upgradeStrategyId);
}
